package com.xinkao.log.datasource;

/**
 * @author 周洋
 * @Description 数据库标识管理类。用于区分数据源连接的不同数据库。
 * @createTime 2021/9/28 16:20
 */
public class DBIdentifier {
    /**
     * 数据库ip
     */
    private static ThreadLocal<String> dbIp = new ThreadLocal<String>();
    public static String getDbIp() {
        return dbIp.get();
    }
    public static void setDbIp(String ip) {
        dbIp.set(ip);
    }

    /**
     * 库名
     */
    private static ThreadLocal<String> dbName = new ThreadLocal<String>();
    public static String getDbName() {
        return dbName.get();
    }
    public static void setDbName(String name) {
        dbName.set(name);
    }

    /**
     * 账号
     */
    private static ThreadLocal<String> username = new ThreadLocal<String>();
    public static String getUsername() {
        return username.get();
    }
    public static void setUsername(String name) {
        username.set(name);
    }

    /**
     * 密码
     */
    private static ThreadLocal<String> password = new ThreadLocal<String>();
    public static String getPassword() {
        return password.get();
    }
    public static void setPassword(String pass) {
        password.set(pass);
    }
}
